public class ControlPanel {
    private String password = "";
    private int incorrectAttempts = 0;
    private boolean isLocked = false;

    public void inputCharacter(char character) {
        password += character;
        if (password.length() == 4) {
            validatePassword();
        }
    }

    private void validatePassword() {
        String correctPassword = "1234";  // 假设正确的密码是"1234"
        if (!password.equals(correctPassword)) {
            incorrectAttempts++;
            if (incorrectAttempts >= 3) {
                lock();
            }
            password = "";
        } else {
            enterSystemFunctionSelectionState();
        }
    }

    private void lock() {
        isLocked = true;
        startTimer(120);
    }

    private void unlock() {
        isLocked = false;
        stopTimer();
    }

    private void enterSystemFunctionSelectionState() {
        // 进入系统功能选择状态
    }

    private void startTimer(int seconds) {
        // 启动计时器，在指定秒数后触发计时器超时事件
    }

    private void stopTimer() {
        // 停止计时器
    }

    // 其他方法和属性...
}




